<template>
  <div class="app-container">
    <el-form :inline="true" ref="ruleForm" :model="formInline" class="demo-form-inline">
      <el-form-item class="with-pre-select" prop="keywords">
        <el-input placeholder="请输入关键词" v-model="formInline.keywords" class="input-with-select" @keyup.enter.native="$emit('on-filter',formInline)">
          <el-select v-model="formInline.searchType" slot="prepend" placeholder="请选择查询范围">
            <!--<el-option label="全部" :value="-1"></el-option>-->
            <el-option label="代理账号" :value="1"></el-option>
            <el-option label="普通域名" :value="3"></el-option>
            <el-option label="专属域名" :value="4"></el-option>
            <!--<el-option label="姓名" :value="2"></el-option>-->
          </el-select>
          <!--<el-button slot="append" icon="el-icon-search"></el-button>-->
        </el-input>
      </el-form-item>
      <!--<el-form-item label="代理佣金模式" prop="commissionId">
        <el-select v-model="formInline.commissionId">
          <el-option label="全部" :value="-1"></el-option>
          <el-option
            v-for="item in modelList"
            :label="item.name"
            :key="item.id"
            :value="item.id"
          ></el-option>
        </el-select>
      </el-form-item>-->
      <el-button class="filter-item" type="primary"  icon="el-icon-search" @click="$emit('on-filter',formInline)">搜索</el-button>
      <el-button @click="selfResetForm('ruleForm')">重置</el-button>
    </el-form>
  </div>
</template>
<script>
  import {getCommissionList} from '@/services/api/commission'
  import {form,grid,pickerOption} from '@/build'
  export default {
    name: "form-filter",
    mixins: [form,grid,pickerOption],
    data() {
      return {
        modelList:[],
        auditFirList:[],
        stepFir: {step:1},
        stepSec: {step:2},
        auditSecList:[],
        formInline: {
          time: undefined,
          status: -1,
          keywords: undefined,
          commissionId: undefined,
          searchType: 1,
        },
      }
    },
    methods: {
      selfResetForm(formName){
        this.resetForm(formName)
        this.$parent.getAll()
      }
    },
    mounted(){
      this.bindGet(getCommissionList,'modelList',{ })
      this.getAll()
    }
  }
</script>

<style lang="scss" scoped>
  .with-pre-select {
    .el-input-group__prepend {
      .el-select {
        width: 160px;
      }
    }
  }

  .money-range {
    .el-input {
      width: 100px;
    }
  }

</style>
